<script>
import { h, useSlots } from 'vue'
import LeverHeading from '@/components/LeverHeading.vue'
export default {
  data () {
    return {
      hi: '下面Div里面是个组件'
    }
  },
  components: {
    props: { item: Object },
    LeverHeading
  },
  // 模版最后就是调用render 进行渲染的
  render: function () {
    const slots = useSlots()
    console.log('slots = ', slots)
    // const defaultSlot = slots.defaultSlot
    // let def = this.$scopedSlots.default({
    //   text: '我是默认插槽'
    // })
    return h('div', { class: 'test' }, [h('p', {}, this.hi), h(LeverHeading, { item: { title: 'dsfsf' } }, { headingSlot: function() { return 'ssss888' }, default: function() { return '9999' } }), h('p', {}, this.hi), h(LeverHeading)])
  }
}

</script>

<style>
.test {
  color: red;
}

</style>
